version 14.2
set more off
capture log close


*     ***************************************************************** *;
*     ***************************************************************** *;
*   File-Name:  analyses.do  	                                        *;
*   Date:       March 1, 2021	                                        *;
*   Author:     Lisa Dellmuth                                           *;
*   Purpose:    Replicate results for paper "Global adaptation 		    *;
*               Governance" in Climate Policy 2021 (Dellmuth&Gustafsson	*; 
*     ****************************************************************  *;
*     ****************************************************************  *;



use expert_data.dta, clear 

tab io 

replace category="Disaster risk reduction" if category=="Disaster Risk Reduction"
replace category="Development banking" if category=="Development bank"
replace category="Humanitarian assistance" if category=="Disaster Relief"
replace category="Multi-issue" if io=="OECD"

drop if io=="EBRD" //too few obs
drop if io=="IADB" //too few obs
drop if io=="OECD" //too few obs

by category, sort: tab io
tab io


*Figure 1

tab mand
tab collaboration
tab programs_policy
tab budget
graph hbar mand collaboration  programs_policy budget, ylabel(1 "Oppose" 2 3 4 5 6 7 8 9 10 "Favor", labsize(vsmall)) ///
legend(order(1 "Discursive (interpret mandate)" 2 "Institutional (collaboration)" 3 "Policy (programs and policy)" 4 "Budgetary (allocate greater budget)")) ///
 exclude0
 
*Figure 2 
graph hbar mand collaboration  programs_policy budget, ylabel(1 "Oppose" 2 3 4 5 6 7 8 9 10 "Favor", labsize(vsmall)) ///
legend(order(1 "Discursive (interpret mandate)" 2 "Institutional (collaboration)" 3 "Policy (programs and policy)" 4 "Budgetary (allocate greater budget)")) ///
 exclude0 over(category, sort(mand) descending) ytitle()


 
 
*Appendix E reliability tests
***************************************************************
 

 
*Table E1: Variance component model
***************************************************************

encode io, gen(ionum)


*Model 1
xtmixed mand || ionum : ||  respondentid :, iterate(20) vce(robust)
eststo variance

*Inter expert correlation
io variance / (io variance + exp variance)
di .827 /(.827+1.878)
*inter expert correlation=.306
*Spearman-Brown formula
di 15*.306/(1+(15-1)*.306) 
*.869

*Statistical significance of random effects:
xtmixed mand, iterate(10)
eststo var0
xtmixed mand || ionum :  , iterate(10) // institutions
eststo var1
xtmixed mand   ||  respondentid :, iterate(10) //experts
eststo var2
lrtest var0 var1
lrtest var0 var2


*Model 2
xtmixed collaboration || ionum : ||  respondentid :, iterate(20) vce(robust)
eststo variance 

*Inter expert correlation
io variance / (io variance + exp variance)
di .765 /(0.765+2.942)
*inter expert correlation=.206
*Spearman-Brown formula
di 18*.206/(1+(18-1)*.206) 
*.824

*Statistical significance of random effects:
xtmixed collaboration, iterate(10)
eststo var0
xtmixed collaboration || ionum :  , iterate(10)
eststo var1
xtmixed collaboration   ||  respondentid :, iterate(10)
eststo var2
lrtest var0 var1
lrtest var0 var2


*Model 3
xtmixed programs_policy || ionum : ||  respondentid :, iterate(10) vce(robust)
eststo variance 
*Inter expert correlation
io variance / (io variance + exp variance)
di .951 /(.951+2.634)
*inter expert correlation=.265
*Spearman-Brown formula
di 18*.265/(1+(18-1)*.265) 
*.866

*Statistical significance of random effects:
xtmixed programs_policy, iterate(10)
eststo var0
xtmixed programs_policy || ionum :  , iterate(10)
eststo var1
xtmixed programs_policy   ||  respondentid :, iterate(10)
eststo var2
lrtest var0 var1
lrtest var0 var2


*Model 4
xtmixed budget || ionum : ||  respondentid :, iterate(10) vce(robust)
eststo variance 
*Inter expert correlation
io variance / (io variance + exp variance)
di 0.570 /(0.570+2.236)
*inter expert correlation=0.203
*Spearman-Brown formula
di 18*0.203/(1+(18-1)*0.203) 
*.821

*Statistical significance of random effects:
xtmixed budget, iterate(10)
eststo var0
xtmixed budget || ionum :  , iterate(10)
eststo var1
xtmixed budget   ||  respondentid :, iterate(10)
eststo var2
lrtest var0 var1
lrtest var0 var2



*F2


gen foundingyear=.
replace foundingyear=1996 if io=="AC"
replace foundingyear=1966 if io=="ADB"
replace foundingyear=1964 if io=="AFDB"
replace foundingyear=1967 if io=="ASEAN" 
replace foundingyear=1991 if io=="EBRD"
replace foundingyear=1951 if io=="EU"
replace foundingyear=1945 if io=="FAO" 
replace foundingyear=1971 if io=="PIF"
replace foundingyear=1985 if io=="SAARC"
replace foundingyear=1983 if io=="SACEP"
replace foundingyear=1965 if io=="UNDP" 
replace foundingyear=1972 if io=="UNEnvironment" 
replace foundingyear=2004 if io=="UNASUR"
replace foundingyear=1946 if io=="WB"
replace foundingyear=1946 if io=="WHO" 

gen age=.
replace age=2018-foundingyear
sum age
hist age
gen un=1
replace un=0 if io=="AC"| io=="ADB"| io=="AFDB"| io=="ASEAN"| io=="CAN"| io=="EBRD"| io=="EU"| ///
 io=="IADB"| io=="IEA"| io=="IOM"| io=="IRENA"| io=="NATO"| io=="OAS"| io=="OSCE"| io=="PIF"| ///
 io=="SAARC"| io=="SACEP"| io=="UNASUR"

tab multiissue

tab q0025 // 1 University degree, 2 PhD, 3 Professor - 0 other

tab q0026 // 1 male, 2 female, 3 other

tab q0020_0001 // importance
rename q0020_0001 importance
recode importance 0=.
tab q0021_0001 //close
rename q0021_0001 close
recode close 0=.
tab cat

xtmixed mand age un multiissue close importance || cat : , iterate(10) vce(robust)
eststo m1
xtmixed collaboration age un multiissue close importance || cat : , iterate(10) vce(robust)
eststo m2
xtmixed programs_policy age un multiissue close importance || cat : , iterate(10) vce(robust)
eststo m3
xtmixed budget age un multiissue close importance || cat : , iterate(10) vce(robust)
eststo m4

*export results 
#delimit ;
esttab m1 m2 m3 m4 using table_E2.rtf,  
starlevels(* .10 ** .05 *** .01) b(%9.3f) scalars(N ll) bic nodepvars 
se(%9.3f) replace;
#delimit cr	

